package com.example.hospitalmanagement.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.hospitalmanagement.R
import com.example.hospitalmanagement.adapter.MedicalInsurancePolicyActivityAdapter
import com.example.hospitalmanagement.bean.MedicalInsurancePolicyItem

/**
 * 医保政策Activity
 *
 * 位置:医院综合-医保政策
 */
class MedicalInsurancePolicyActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_medical_insurance_policy)
        initView()
    }

    /**
     * 适配器设置,条目布局显示
     */
    private fun initView() {
        val policyItem: RecyclerView = findViewById(R.id.policy_item)
        policyItem.layoutManager = LinearLayoutManager(this)
        val dataList: MutableList<MedicalInsurancePolicyItem> = mutableListOf()
        for (index in 1..5) {
            dataList.add(
                MedicalInsurancePolicyItem(
                    "医保患者入、出院办理", "2022-02-19"
                )
            )
        }
        val adapter = MedicalInsurancePolicyActivityAdapter(this)
        adapter.dataList = dataList
        policyItem.adapter = adapter
    }
}